public class Test02 {

	public static void main(String[] args) {
		(new Test02()).test(0, 0);
	}

	public int test(int a, int b) {
		while (a != b) {
			if (a > b) {
				a = a - b;
			} else {
				b = b - a;
			}
		}
		return a;
	}

}